package com.jackson.springevent.publisher;

/*
 * Author: JacksonCoder
 * FileName: EventPublisher
 * Version: 1.0.0
 * Date: 2025/5/28
 */

import com.jackson.springevent.event.CustomEvent;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.stereotype.Service;

@Service
public class EventPublisher {

    @Autowired
    private ApplicationEventPublisher publisher;

    public void publishCustomEvent(String message){
        CustomEvent customEvent = new CustomEvent(this, message);
        publisher.publishEvent(customEvent);
    }

}
